package com.zte.claa.inficombo.csa.app.model.version;

import java.sql.Timestamp;

public class DevVersionUpdateLog {
	/**
	 *  0--正常工作状态；
		1--升级准备就绪；
		2--升级准备失败；
		3--升级成功；
		4--升级失败；
	 */
	public static final int RET_CODE_NORMAL  = 0;
	public static final int RET_CODE_READY   = 1;
	public static final int RET_CODE_UNREADY = 2;
	public static final int RET_CODE_SUCC    = 3;
	public static final int RET_CODE_FAIL    = 4;
	
	// 注：以下属性，JS解析插件可以不填写taskid，rpttime，blockno, appeui, projectid, devtype。
	private String deveui; 			//		设备编号	VARCHAR(50)		N	主键
	private String taskid; 			//		任务编号	VARCHAR(200), 注：JS插件中可以不设置.
	private Timestamp rpttime; 		//		上报时间	Timestamp		N	升级进度上报时间
	private int blockno = 0; 		//		当前版本块编号	Int	0	N	设备响应中确认的版本数据块编号
	private String devtype; 		//		设备类型	VARCHAR(100)		N	
	private String appeui; 			//		应用编号	VARCHAR(50)		N	
	private String projectid; 		//		项目编号	VARCHAR(200)		N	
	private int retcode = RET_CODE_NORMAL;  //终端版本升级结果
	private String retbitmap;   	//      终端版本升级结果位图
	private String remark; 
	
	public DevVersionUpdateLog(){
		this.rpttime = new Timestamp(System.currentTimeMillis());
		// JS插件中可以不设置.
		this.taskid = "";
	}

	public String getDeveui() {
		return deveui;
	}

	public void setDeveui(String deveui) {
		this.deveui = deveui;
	}

	public String getTaskid() {
		return taskid;
	}

	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}

	public Timestamp getRpttime() {
		return rpttime;
	}

	public void setRpttime(Timestamp rpttime) {
		this.rpttime = rpttime;
	}

	public int getBlockno() {
		return blockno;
	}

	public void setBlockno(int blockno) {
		this.blockno = blockno;
	}

	public String getDevtype() {
		return devtype;
	}

	public void setDevtype(String devtype) {
		this.devtype = devtype;
	}

	public String getAppeui() {
		return appeui;
	}

	public void setAppeui(String appeui) {
		this.appeui = appeui;
	}

	public int getRetcode() {
		return retcode;
	}

	public void setRetcode(int retcode) {
		this.retcode = retcode;
	}

	public String getRetbitmap() {
		return retbitmap;
	}

	public void setRetbitmap(String retbitmap) {
		this.retbitmap = retbitmap;
	}

	public String getProjectid() {
		return projectid;
	}

	public void setProjectid(String projectid) {
		this.projectid = projectid;
	}
	
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("devtype=").append(this.devtype).append(", ");
		sb.append("deveui=").append(this.deveui).append(", ");
		sb.append("taskid=").append(this.taskid).append(", ");
		sb.append("rpttime=").append(this.rpttime).append(", ");
		sb.append("blockno=").append(this.blockno).append(", ");
		sb.append("appeui=").append(this.appeui).append(", ");
		sb.append("retcode=").append(this.retcode).append(", ");
		sb.append("retbitmap=").append(this.retbitmap).append(", ");
		sb.append("projectid=").append(this.projectid).append(", ");
		sb.append("remark=").append(this.remark);
		return sb.toString();
	}
}
